package data;

public class cell 
{
	boolean wallNorth;
	boolean wallEast;
	boolean wallWest;
	boolean wallSouth;
	
	boolean pathNorth = false;
	boolean pathEast = false;
	boolean pathSouth = false;
	boolean pathWest = false;
	
	boolean backtrackNorth;
	boolean backtrackEast;
	boolean backtrackSouth;
	boolean backtrackWest;
	
	boolean start;
	boolean exit;
	
	int x;
	int y;
	
	public void setPathEast(boolean pathEast) {
		this.pathEast = pathEast;
	}

	public void setPathNorth(boolean pathNorth) {
		this.pathNorth = pathNorth;
	}

	public void setPathSouth(boolean pathSouth) {
		this.pathSouth = pathSouth;
	}

	public void setPathWest(boolean pathWest) {
		this.pathWest = pathWest;
	}

	public cell(int x, int y)
	{
		this.wallNorth = true;
		this.wallEast = true;
		this.wallWest = true;
		this.wallSouth = true;
		
		this.start = false;
		this.exit = false;
		
		this.x = x;
		this.y = y;
	}
	
	public String toString()
	{
		return "X: " + x + " & Y: " + y;
	}

	public void setTo(String direction)
	{
		if(direction == "North")
		{
			this.pathNorth = true;
		}
		else if(direction == "East")
		{
			this.pathEast = true;
		}
		else if(direction == "South")
		{
			this.pathSouth = true;
		}
		else if(direction == "West")
		{
			this.pathWest = true;
		}
	}
	
	public void setFrom(String direction)
	{
		if(direction == "North")
		{
			this.pathNorth = true;
		}
		else if(direction == "East")
		{
			this.pathEast = true;
		}
		else if(direction == "South")
		{
			this.pathSouth = true;
		}
		else if(direction == "West")
		{
			this.pathWest = true;
		}
	}
	
	public boolean isWallEast() {
		return wallEast;
	}

	public void setWallEast(boolean wallEast) {
		this.wallEast = wallEast;
	}

	public boolean isWallNorth() {
		return wallNorth;
	}

	public void setWallNorth(boolean wallNorth) {
		this.wallNorth = wallNorth;
	}

	public boolean isWallSouth() {
		return wallSouth;
	}

	public void setWallSouth(boolean wallSouth) {
		this.wallSouth = wallSouth;
	}

	public boolean isWallWest() {
		return wallWest;
	}

	public void setWallWest(boolean wallWest) {
		this.wallWest = wallWest;
	}

	public boolean isExit() {
		return exit;
	}
	
	public void setExit(boolean exit)
	{
		this.exit = exit;
	}
	
	public void setStart(boolean start)
	{
		this.start = start;
	}

	public boolean isStart() {
		return start;
	}
	
	public void setBacktrackEast(boolean backtrackEast) {
		this.backtrackEast = backtrackEast;
	}

	public void setBacktrackNorth(boolean backtrackNorth) {
		this.backtrackNorth = backtrackNorth;
	}

	public void setBacktrackSouth(boolean backtrackSouth) {
		this.backtrackSouth = backtrackSouth;
	}

	public void setBacktrackWest(boolean backtrackWest) {
		this.backtrackWest = backtrackWest;
	}

	public int getX()
	{
		return this.x;
	}
	
	public int getY()
	{
		return this.y;
	}
	
	public boolean isFullyWalled()
	{
		if(wallNorth && wallEast && wallSouth && wallWest)
			return true;
		else
			return false;
	}

	public boolean isBacktrackEast() {
		return backtrackEast;
	}

	public boolean isBacktrackNorth() {
		return backtrackNorth;
	}

	public boolean isBacktrackSouth() {
		return backtrackSouth;
	}

	public boolean isBacktrackWest() {
		return backtrackWest;
	}

	public boolean isPathEast() {
		return pathEast;
	}

	public boolean isPathNorth() {
		return pathNorth;
	}

	public boolean isPathSouth() {
		return pathSouth;
	}

	public boolean isPathWest() {
		return pathWest;
	}
}
